package com.lelefly.base.controller;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.core.util.UuidUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lelefly.base.Validator.LeleflyUserValidator;
import com.lelefly.base.model.LeleflyUserVo;
import com.lelefly.base.model.Result;
import com.lelefly.base.po.FarmlandAccess;
import com.lelefly.base.po.FarmlandInfo;
import com.lelefly.base.po.UavInfo;
import com.lelefly.base.po.UavMaintenance;
import com.lelefly.base.serviceImp.FarmlandAccessService;
import com.lelefly.base.serviceImp.FarmlandInfoService;
import com.lelefly.base.serviceImp.UavInfoService;
import com.lelefly.base.serviceImp.UavMaintenanceService;
import com.lelefly.base.utils.LUUIDutils;

@Controller
@RequestMapping("/uavinfo")
public class UavMaintenanceController extends BaseController{

	@Resource
	public UavMaintenanceService uavMaintenanceService;
	
	

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@RequestMapping(value="/getUavMaintenance",produces="application/json;charset=utf-8")
	@ResponseBody
	public Result getUavMaintenance(String uavnm){
		Result<UavMaintenance> result=null;
		try {
			result = uavMaintenanceService.getUavMaintenance(uavnm);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			getLogger().info("----->>"+e.getLocalizedMessage());
		}
		return result;
	}
	
	
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@RequestMapping(value="/addUavMaintenance",produces="application/json;charset=utf-8")
	@ResponseBody
	public Result addUavMaintenance(UavMaintenance uavMaintenance){
		Result<UavMaintenance> result=null;
		try {
			result = uavMaintenanceService.addUavMaintenance(uavMaintenance);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			getLogger().info("----->>"+e.getLocalizedMessage());
		}
		return result;
	}
	
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@RequestMapping(value="/delMaintenanceService",produces="application/json;charset=utf-8")
	@ResponseBody
	public Result delMaintenanceService(String uavnm){
		Result<FarmlandAccess> result=null;
		try {
			result = uavMaintenanceService.delUavMaintenance(uavnm);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			getLogger().info("----->>"+e.getLocalizedMessage());
		}
		return result;
	}
	
	
}
